package com.tledu.ssm.core.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author cyrus
 */
@Data
@NoArgsConstructor
public class AjaxResult<T> {
    private boolean success;
    private int code;
    private String msg;
    private T data;

    public AjaxResult(T data) {
        this.success = true;
        this.code = 200;
        this.msg = "操作成功";
        this.data = data;
    }

    public AjaxResult(int code, String msg) {
        this.success = false;
        this.code = code;
        this.msg = msg;
    }
}
